package com.yike.order.entity;

import java.math.BigDecimal;
import com.baomidou.mybatisplus.annotation.TableName;
import java.util.Date;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.yike.common.base.BaseEntity;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import javax.validation.constraints.NotBlank;
import org.springframework.format.annotation.DateTimeFormat;

/**
 * 订单表
 *
 * @author yike
 * @since 2024-07-18
 */
@Data
@Accessors(chain = true)
@EqualsAndHashCode(callSuper = true)
@TableName("qy_order")
@ApiModel(value = "Order对象")
public class Order extends BaseEntity {
    private static final long serialVersionUID = 1L;

    @ApiModelProperty("用户id")
    private Long userId;

    @ApiModelProperty("店铺ID")
    private Long shopId;

    @ApiModelProperty("订单状态: 0.待付款 1.已付款 2.未支付 3.已退款 4.部分退款  ")
    private Integer status;

    @NotBlank(message = "订单编号不能为空")
    @ApiModelProperty("订单编号")
    private String orderNo;

    @ApiModelProperty("支付方式: 1.微信 2.支付宝")
    private Integer payway;

    @ApiModelProperty("支付金额")
    private BigDecimal amount;

    @ApiModelProperty("退款金额")
    private BigDecimal refundAmount;

    @ApiModelProperty("实际金额")
    private BigDecimal actualAmount;

    @ApiModelProperty("设备编号")
    private String macNo;

    @ApiModelProperty("支付时间")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date payTime;

    @ApiModelProperty("微信订单号")
    private String wxTransactionId;

    @ApiModelProperty("备注")
    private String remark;

    @ApiModelProperty("失败原因")
    private String errorDesc;

    @ApiModelProperty("云助手订单：1是 0否")
    private Boolean cloudGarrisonFlag;

    @ApiModelProperty("云助手code（用来统计某一次值守内产生的订单）")
    private String cloudGarrisonCode;

    @ApiModelProperty("平台分佣比例")
    private Integer platformCommissionRate;

    @ApiModelProperty("平台分佣金额")
    private BigDecimal platformAmount;

    @ApiModelProperty("交易流水号")
    private String tradeNo;

    @ApiModelProperty("拉卡拉对账单流水号")
    private String logNo;



}
